﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions; 

namespace CoolCode.Data
{
    public interface IDataContext : IDisposable
    {
        string ConnectionString { get; set; }
        IRepository<T> CreateRepository<T>() where T : class;
        void SubmitChanges();
        ILoadOption LoadOptions { get; }
    }
        
    public interface ILoadOption
    {
        ILoadOption LoadWith<T>(Expression<Func<T, object>> property);
        void EndLoad();
    }

    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class ProviderNameAttribute : Attribute
    {
        public string Value { get; private set; }

        public ProviderNameAttribute(string value)
        {
            this.Value = value;
        }
    }
}
